<!-- 车辆信息 -->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title></title>
  <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
  <link rel="stylesheet" href="./css/font.css">
  <link rel="stylesheet" href="./css/xadmin.css">
  <script type="text/javascript" src="./js/jquery-2.1.0.js"></script>
  <script src="./lib/layui/layui.js" charset="utf-8"></script>
  <script type="text/javascript" src="./js/Global.js"></script>
  <style>
    .wrap {
      padding: 20px;
    }

    .select {
      height: 40px;
      padding: 20px 0;
      border-bottom: 1px solid #ccc;
      text-align: center;
    }

    .search {
      width: 200px;
      height: 38px;
      margin: 0 auto;
      display: inline-block;
      padding-top: 1px;

    }

    .layui-input {
      width: 200px;
    }

    .btn {
      display: inline-block;

    }
    .layui-table td, .layui-table th {
      padding: 2px;
    }
  </style>
</head>

<body>
  <div class="wrap">
    <table id="table" lay-filter="table" class="layui-table">
      <thead id="head">
        <tr>
          <th>车辆数</th>
          <th rowspan="2">客户名称</th>
          <th rowspan="2">车辆牌号</th>
          <th rowspan="2">自编车号</th>
          <th rowspan="2">车辆品牌</th>
          <th rowspan="2">车辆型号</th>
          <th rowspan="2">购买时间</th>
          <th rowspan="2">轮胎规格</th>
          <th colspan="2">司机1</th>
          <th colspan="2">司机2</th>
          <th colspan="2">单位主管</th>
          <th colspan="2">单位维修</th>
          <th rowspan="2">备注</th>
        </tr>
        <tr>
          <th class="cutnum">16</th>
          <th>姓名</th>
          <th style="width: 5%;">电话</th>
          <th>姓名</th>
          <th style="width: 5%;">电话</th>
          <th>姓名</th>
          <th style="width: 5%;">电话</th>
          <th>姓名</th>
          <th style="width: 5%;">电话</th>
        </tr>
        
      </thead>
      <tbody class="weblist">
          
      </tbody>
    </table>
  </div>
</body>
<script>
 
$.ajax({
  url:`${API}/real/selectByCustomeId?cId=${loadUserInfo.customer.id}`,
  type:'get',
  success: function (res) {
    console.log(res)
    $('.cutnum').html(res.count)
    let arr = res.data
    let str = ``
    $.each(arr,function (i) {
      let json = arr[i]
      console.log(json)
      str += `<tr>
              <td>${arr.length - i}</td>
              <td>${json.customer_name ==null ? '' : json.customer_name}</td>
              <td>${json.car_plate ==null ? '' : json.car_plate}</td>
              <td>${json.car_number ==null ? '' : json.car_number}</td>
              <td>${json.car_brand ==null ? '' : json.car_brand}</td>
              <td>${json.car_model ==null ? '' : json.car_model}</td>
              <td>${json.car_gz_date ==null ? '' : json.car_gz_date}</td>
              <td>${json.guige ==null ? '' : json.guige}</td>
              <td>${json.driver_a ==null ? '' : json.driver_a}</td>
              <td>${json.driver_a_phone ==null ? '' : json.driver_a_phone}</td>
              <td>${json.driver_b  ==null? '' : json.driver_b}</td>
              <td>${json.driver_b_phone ==null ? '' : json.driver_b_phone}</td>
              <td>${json.supervisor_name ==null ? '' : json.supervisor_name}</td>
              <td>${json.supervisor_phone ==null ? '' : json.supervisor_phone}</td>
              <td>${json.personnel_name ==null ? '' : json.supervisor_phone}</td>
              <td>${json.personnel_phone ==null ? '' : json.personnel_phone}</td>
              <td>${json.bz ==null ? '' :json.bz}</td>
            </tr>`
    })
    $('.weblist').append(str)
    
  }
})



</script>

</html>